home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 1.iso / dist / fw_teTeX.idb / usr / freeware / bin / xdvi.z / xdvi
Text File  |  2001-01-10  |  2KB  |  49 lines

  1. #!/bin/sh
  2.  
  3. # This is the xdvi wrapper script for teTeX, version 0.2.
  4. # Copyright Thomas Esser, 1998. Permission to distribute under the terms
  5. # of the GNU general public license version 2 or later.
  6.  
  7. # This script sets some environment variables to make sure that xdvi's
  8. # ressource file in $XDVIINPUTS/xdvi is read by xdvi.bin.
  9. # Special care was taken to make this work for old R3, too. Therefore,
  10. # we need to modify XAPPLRESDIR. If you are running R4 or later, you
  11. # can set XUSERFILESEARCHPATH for user specific application default
  12. # files. You cannot use XAPPLRESDIR for user specific application default
  13. # files.
  14.  
  15. test -f /bin/sh5 && test -z "$RUNNING_SH5" \
  16.   && test x"`(uname -s) 2>&1`" = xULTRIX \
  17.   && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; }
  18. RUNNING_SH5=
  19.  
  20. test -f /bin/bsh && test -z "$RUNNING_BSH" \
  21.   && test x"`(uname -s) 2>&1`" = xAIX \
  22.   && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; }
  23. RUNNING_BSH=
  24.  
  25. # -help and -version only work if they are the only options. Therefore,
  26. # we cannot give the "-name xdvi" parameter in that case.
  27. case "$#:$1" in
  28.   1:-help|1:-version)
  29.     NAMEOPT=;;
  30.   *)
  31.     NAMEOPT='-name xdvi';;
  32. esac
  33.  
  34. XDVIINPUTS="$XDVIINPUTS":'$TEXMF/{xdvi,web2c}'; export XDVIINPUTS
  35. xdviappfile=`kpsewhich -progname=xdvi --format='other text files' XDvi`
  36. if test -n "$xdviappfile"; then
  37.   xdviappdir=`dirname "$xdviappfile"`
  38.   xdviapppath="${xdviappdir}/%N"
  39.  
  40.   # For R3, we have to set XAPPLRESDIR.
  41.   XAPPLRESDIR="$xdviappdir"; export XAPPLRESDIR
  42.  
  43.   # For R4 or later, we have to set XFILESEARCHPATH, since XAPPLRESDIR might
  44.   # be ignored (if XUSERFILESEARCHPATH is set)
  45.   XFILESEARCHPATH="$xdviapppath:${XFILESEARCHPATH-%D}"; export XFILESEARCHPATH
  46. fi
  47.  
  48. exec xdvi.bin $NAMEOPT ${1+"$@"}
  49.